﻿<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>运输管理</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

      <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.9&ak=FEf57a4866b7c8bbc8ad003e237f4110"></script>
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>

     <link rel="stylesheet" type="text/css" href="../js/jquery-easyui-1.4.4/themes/metro/easyui.css">  
    <link rel="stylesheet" type="text/css" href="../js/jquery-easyui-1.4.4/themes/mobile.css">  
    <link rel="stylesheet" type="text/css" href="../js/jquery-easyui-1.4.4/themes/icon.css">  
 
    <script type="text/javascript" src="../js/jquery-easyui-1.4.4/jquery.min.js"></script>  
    <script type="text/javascript" src="../js/jquery-easyui-1.4.4/jquery.easyui.min.js"></script> 
    <script type="text/javascript" src="../js/jquery-easyui-1.4.4/jquery.easyui.mobile.js"></script> 
       <script src="../js/jquery-easyui-1.4.4/easyloader.js" type="text/javascript"></script>

    <link href="css/main.css" rel="stylesheet" type="text/css" />
    <link href="css/maingrid.css" rel="stylesheet" type="text/css" />

    <script src="scripts/echarts-m-1.0.0/echarts-m-1.0.0/dist/echarts-all.js"></script>

    <script src="../../Scripts/jsbase.js" type="text/javascript"></script>
    <script src="../../Scripts/webcontrols/datasource.js" type="text/javascript"></script>
    <script src="scripts/store.js"></script>

    <script src="scripts/page.js"></script>
    <script src="scripts/from.js"></script>
    <script src="scripts/grid.js"></script>
    <script src="scripts/textbox.js"></script>

    <script src="scripts/bus/packlist.js"></script>
    <script src="scripts/bus/transport.js"></script>



</head>
<body class="easyui-layout">
    <div data-options="region:'north',border:false,collapsible:false" style="height:32px;overflow:hidden;">
        <div class="panel-header" style="padding:0;border-width:1px 0;text-align:center">
            <a href="javascript:outlogin()" class="easyui-linkbutton" data-options="iconCls:'icon-back'" style="position:absolute;left:3px;top:3px"></a>
            <span class="panel-title" id="welcom" style="line-height:32px"></span>
        </div>
    </div>
    <div data-options="region:'center',border:false">
        <div id="tt" data-options="tabWidth:100,tabHeight:60,fit:true,tabPosition:'bottom',plain:true">
            <div title="<span class='tt-inner'><img src='images/hy.png' width='30' height='30' style='margin:0;'><br>欢迎</span>" style="padding:10px;">
                <div id="main" style="height:500px;border:1px solid #ccc;padding:10px;"></div>
            </div>
            <div title="<span class='tt-inner'><img src='images/rk.png' width='30' height='30' style='margin:0'><br>装车</span>" style="padding:10px">
                <div id="tabpage1"></div>
            </div>
            <div title="<span class='tt-inner'><img src='images/xsck.png' width='30' height='30' style='margin:0'><br>运输</span>" style="padding:10px">
                <div id="tabpage2"></div>
            </div>
            <div title="<span class='tt-inner'><img src='images/zp.png' width='30' height='30' style='margin:0'><br>签收</span>" style="padding:10px">
                <div id="tabpage3"></div>
            </div>
        </div>
    </div>
    <script>
        $(function () {
            easyloader.locale = 'zh_CN';
            var t = $('#tt').tabs();
            t.find('div.tabs-header li:last').css('marginRight', 0);
            var hwidth = t.find('div.tabs-header').width();
            var tabs = t.tabs('tabs');
            var width = Math.floor(hwidth / tabs.length);
            var lastp;
            for (var i = 0; i < tabs.length; i++) {
                var p = tabs[i];
                var opts = p.panel('options');
                opts.tabWidth = width;
                lastp = opts;
            }
            lastp.tabWidth += hwidth - width * tabs.length;
            t.tabs('resize');
        });
        function login() {
            var user = $("#user").val();
            if (user == "") {
                $.messager.alert('异常', "未输入用户名，不能登录！", 'error');
                return;
            }
            var pass = $("#pass").val();
            if (pass == "") {
                $.messager.alert('异常', "未输入密码，不能登录！", 'error');
                return;
            }
            try {
                webjs.login(user, pass, function (item) {
                    var wxconfig = webjs.post("Way.Wx.JS_SDK", "getjsapi", "");
                    wx.config(wxconfig);
                    $("#login").dialog("close");
                    $("#login").remove();
                    $("#dd").remove();
                    $("#welcom").html("运输系统欢迎您：" + webjs.username);
                    $('#tt').tabs({
                        onSelect: function (title, index) {
                            if (index == 1) {
                                packlist();
                            }
                            if (index == 2) {
                                transport();
                            }
                            if (index == 3) {
                                getcamera();
                            }
                        }
                    });
                    var myChart = echarts.init(document.getElementById('main'));
                    myChart.setOption({
                        tooltip: {
                            trigger: 'axis'
                        },
                        legend: {
                            data: ['收货数量', '发货数量']
                        },
                        toolbox: {
                            show: true,
                            feature: {
                                mark: { show: true },
                                dataView: { show: true, readOnly: false },
                                magicType: { show: false, type: ['line', 'bar'] },
                                restore: { show: false },
                                saveAsImage: { show: true }
                            }
                        },
                        calculable: true,
                        xAxis: [
                            {
                                type: 'category',
                                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
                            }
                        ],
                        yAxis: [
                            {
                                type: 'value',
                                splitArea: { show: true }
                            }
                        ],
                        series: [
                            {
                                name: '收货数量',
                                type: 'bar',
                                data: [12, 23, 455, 33, 64, 32, 23, 23, 56, 133, 121, 3543]
                            },
                            {
                                name: '发货数量',
                                type: 'bar',
                                data: [12, 23, 455, 33, 64, 32, 23, 23, 56, 133, 121, 3543]
                            }
                        ]
                    });
                    myChart.resize();
                });
            }
            catch (e) {
                $.messager.alert('异常', e.Message, 'info');
            }
        }
      
        function outlogin() {
            $.messager.confirm('退出', '您确认退出运输管理系统？', function (ok) {
                if (ok) {
                    webjs.outlogin();
                    window.location.href = "index.html";
                }
                return false;
            });
        }
    </script>
    <div id="login" class="easyui-dialog" title="登录运输系统" data-options="fit:true,border:false,resizable: false,draggable:false,closable:false">
        <div style="text-align:center;margin:20px;overflow:hidden">
            <img src="" style="margin:0">
        </div>
        <div style="padding:0 20px">
            <div class="m-item" style="border-bottom:1px solid #eee">
                <div class="m-label">用户:</div>
                <div><input id="user" class="m-input" placeholder="用户"></div>
            </div>
            <div class="m-item" style="border-bottom:1px solid #eee">
                <div class="m-label">密码:</div>
                <div><input id="pass" class="m-input" type="password" placeholder="密码"></div>
            </div>
            <div style="text-align:center;margin-top:30px">
                <a href="javascript:login()" class="easyui-linkbutton" style="width:40%"><span style="font-size:16px">登录</span></a>
                <a href="javascript:open()" class="easyui-linkbutton" style="width:40%"><span style="font-size:16px">设置</span></a>
                <!--<a href="javascript:test()" class="easyui-linkbutton" style="width:40%"><span style="font-size:16px">测试</span></a>-->
            </div>
        </div>
    </div>
    <div id="temp"></div>
</body>

</html>